﻿using Authentication.Configuration;
using Authentication.Model.Model;
using Common.Data.Extensions;

namespace Authentication.Data.DBConfig
{
    public class ObjectConfiguration : DBConfig<ApplicationObject>
    {
        public ObjectConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(x => new { x.ApplicationKey, x.Id });
            Property(c => c.Id).IsRequired().HasMaxLength(32);
            Property(c => c.ObjectUrl).HasMaxLength(250);
            Property(c => c.ObjectNameLocal).HasMaxLength(100);
            Property(c => c.ObjectNameEnglish).HasMaxLength(100);
            Property(c => c.ParentId).HasMaxLength(32);
            Property(c => c.Active).HasMaxLength(1);
        }
    }
}
